import App from './App'
import WhtRequestPlugin from '@/uni_modules/wht-request/js_sdk/install.js'

// #ifndef VUE3
import Vue from 'vue'
import './uni.promisify.adaptor'
Vue.config.productionTip = false
App.mpType = 'app'

// 注册请求插件
Vue.use(WhtRequestPlugin, {
    baseURL: 'https://jsonplaceholder.typicode.com',
    timeout: 10000,
    header: {
        'Content-Type': 'application/json'
    }
})

const app = new Vue({
  ...App
})
app.$mount()
// #endif

// #ifdef VUE3
import { createSSRApp } from 'vue'
export function createApp() {
  const app = createSSRApp(App)
  
  // 注册请求插件
  app.use(WhtRequestPlugin, {
      baseURL: 'https://jsonplaceholder.typicode.com',
      timeout: 10000,
      header: {
          'Content-Type': 'application/json'
      }
  })
  
  return { app }
}
// #endif